Skip to content

fix: attempt to retrieve online from offline player for perm attachments#3182

Merged
NotMyFault merged 3 commits intomainfrom
fix/offline-player-perm-attachment
Apr 30, 2025
Merged

fix: attempt to retrieve online from offline player for perm attachments#3182
NotMyFault merged 3 commits intomainfrom
fix/offline-player-perm-attachment

Conversation

@dordsor21
Copy link
Copy Markdown
Member

No description provided.

@dordsor21 dordsor21 requested a review from a team as a code owner April 26, 2025 09:37
@github-actions github-actions Bot added the Bugfix This PR fixes a bug label Apr 26, 2025
@dordsor21
Copy link
Copy Markdown
Member Author

Thoughts?

image

@MsMaciek123
Copy link
Copy Markdown

@dordsor21 by offline player i meant player instance that returns false for isOnline(), not necessarily OfflinePlayer instance.
See #3183

@dordsor21 dordsor21 force-pushed the fix/offline-player-perm-attachment branch from 416158a to 0284432 Compare April 26, 2025 10:56
@dordsor21
Copy link
Copy Markdown
Member Author

@dordsor21 by offline player i meant player instance that returns false for isOnline(), not necessarily OfflinePlayer instance. See #3183

Altered

@MsMaciek123
Copy link
Copy Markdown

I don't think returning null here is a good idea, especially if function isn't marked with nullable itself. I think it's better to return noop attachment or proper attachment but not add it to the hashmap.

@dordsor21
Copy link
Copy Markdown
Member Author

I don't think returning null here is a good idea, especially if function isn't marked with nullable itself. I think it's better to return noop attachment or proper attachment but not add it to the hashmap.

The attachment is only used for setting permissions (e.g. when toggling bypass) so null is acceptable here. I've marked the method as nullable as well

@Huge-mistake
Copy link
Copy Markdown

Could this PR be merged now?

@dordsor21 dordsor21 requested a review from a team April 30, 2025 14:29
Copy link
Copy Markdown
Member

@PierreSchwang PierreSchwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope the WeakMap really works ^^'

@NotMyFault NotMyFault merged commit 3c2b643 into main Apr 30, 2025
11 checks passed
@NotMyFault NotMyFault deleted the fix/offline-player-perm-attachment branch April 30, 2025 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix This PR fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants